<?php

namespace App\Models\IM;

use App\Models\BaseModel;

class Group extends BaseModel
{

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'group_id'
    ];

    /**
     * The attributes excluded from the model's JSON form.
     *
     * @var array
     */
    protected $hidden = [
        'created_at',
        'updated_at',
    ];

    protected $primaryKey = 'group_id';
    protected $dateFormat = 'U';

    /**
     * 获取群
     * @param $id
     * @return mixed
     */
    public function getGroup($id){
        $data = $this->where('group_id', $id)->first();
        return $this->after($data);
    }
}
